const util = require('util');
const EventEmitter = require('events');


function MyEventSource()
{
    EventEmitter.call(this);
}

util.inherits(MyEventSource, EventEmitter);

var evtSrc = new MyEventSource();

evtSrc.on('onEvent1', function (param)
{
    console.log('event1 occured! Param is: ' + param);
});


evtSrc.emit("onEvent1", "param1");
evtSrc.emit("onEvent1", "param1");
evtSrc.emit("onEvent1", "param1");

var obj = new Object();
obj.age = 26;

var jsonString = JSON.stringify(obj);

var objFromJson = JSON.parse(str);
objFromJson.name;
